<template>
  <el-menu :default-active="active"
           class="el-menu-vertical-demo"
           background-color="#545c64"
           text-color="#fff"
           active-text-color="#ffd04b"
           router>
    <el-submenu index="1">
      <template slot="title">
        <i class="el-icon-s-goods"></i>
        <span>仓库管理</span>
      </template>
      <el-menu-item index="manage">商品管理</el-menu-item>
      <el-menu-item index="warning">商品预警</el-menu-item>
    </el-submenu>
    <el-menu-item index="2">
      <i class="el-icon-menu"></i>
      <span slot="title">销售管理</span>
    </el-menu-item>
    <el-submenu index="3">
      <template slot="title">
        <i class="el-icon-s-goods"></i>
        <span>入库管理</span>
      </template>
      <el-menu-item index="pull-order">入库订单</el-menu-item>
      <el-menu-item index="count">入库统计</el-menu-item>
    </el-submenu>

  </el-menu>
</template>

<script>
export default {
  data () {
    return {
      active: 'manage'
    }
  },
  created () {
    let path = this.$route.path.replace('/', '')
    console.log(path);
    this.active = path;
  }

}
</script>

<style lang="less" scoped>
.menu {
  height: 100%;
}
</style>